package advance_2;

import java.util.Calendar;

public class CalTest2 {

    public static void main(String[] args) {
        //输出本月 星期天是几号
        Calendar c=Calendar.getInstance();//
        c.set(Calendar.DAY_OF_MONTH,1);//起点
        System.out.println(c.getTime());
        //找到本月多少天
        int days=c.getActualMaximum(Calendar.DAY_OF_MONTH);
        System.out.println(days);
        for(int i=0;i<days;i++){
            if(c.get(Calendar.DAY_OF_WEEK)==1)
            {
                System.out.println(c.getTime());
            }
            c.add(Calendar.DAY_OF_MONTH,1);
        }
    }
}
